package com.feidee.data.report.util;

import com.feidee.data.report.dao.IFunnelAnalyseDao;
import com.feidee.data.report.model.FunnelResult;

import java.util.List;
import java.util.concurrent.Callable;

public class FunnelAnalyseThread implements Callable<List<FunnelResult>> {
	private IFunnelAnalyseDao funnelAnalyseDao;
	private String searchSql;
	private String request_id;
	private int databaseNum;
	private int eventNum;

	public FunnelAnalyseThread(String request_id, IFunnelAnalyseDao funnelAnalyseDao, String searchSql, int eventNum, int databaseNum) {
		this.funnelAnalyseDao = funnelAnalyseDao;
		this.request_id = request_id;
		this.searchSql = searchSql;
		this.eventNum = eventNum;
		this.databaseNum = databaseNum;
	}

	@Override
	public List<FunnelResult> call() throws Exception {
		List<FunnelResult> funnelResults = funnelAnalyseDao.runSql(request_id, searchSql, eventNum, databaseNum);
		return funnelResults;
	}
}
